<%
    def tableDefine=tableModel.tableDefine;
    def columns=tableDefine.columns;
    def pkColumn=tableDefine.getPkColumn();
    def pkJavaType=tableNameUtil.getDataType(pkColumn?.columnType);
%>package ${config.basePackage}.domain${PubUtils.addStrAfterSeparator(config.category,"." )};

import lombok.Data;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.Table;
import java.io.Serializable;

/**
 * ${tableDefine.cnname} jpa实体bean
 *
 * @author ${config.author}
 * @date ${config.nowDate}
 */
@Entity
@Table(name = "${tableDefine.dbTableName}")
@Data
public class ${tableDefine.id} implements Serializable{

  private static final long serialVersionUID = ${PubUtils.getRandomLong()}L;

<% if(pkColumn!=null) { %>
    @Id
    @Column(name = "${pkColumn.columnName}")
    private ${pkJavaType} ${pkColumn.dataName};
<%}%>
<%
    columns.each{
        if(!it.getIsPK()) {
            println """	/**  ${it.cnname}  */""";
            println """ @Column(name="${it.columnName}", length = ${it.length})""";
            println """	private ${tableNameUtil.getDataType(it.columnType)} ${it.dataName};"""
        }
    };

%>
}
